package com.zxn.tablayoutsamples.ui

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.zxn.tablayout.ProminentTabLayout
import com.zxn.tablayout.listener.CustomTabEntity
import com.zxn.tablayoutsamples.R
import com.zxn.tablayoutsamples.entity.TabEntity

/**
 *  Created by zxn on 2021/5/18.ProminentTabListActivity
 */
class ProminentTabActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_prominent_tab)
        val prominentTabA = findViewById<ProminentTabLayout>(R.id.prominentTabA)
        val prominentTabB = findViewById<ProminentTabLayout>(R.id.prominentTabB)
        val prominentTabC = findViewById<ProminentTabLayout>(R.id.prominentTabC)


        val list = mutableListOf(
            TabEntity("常见"),
            TabEntity("蛋白"),
            TabEntity("果蔬"),
            TabEntity("清凉")
        )
        prominentTabA.setTabData(list as List<CustomTabEntity>?)
        //prominentTabA.tabEntityList = list;

//        prominentTabB.tabEntityList = (mutableListOf(
//            TabEntity("鱼宠"),
//            TabEntity("道具"),
//            TabEntity("背景"),
//            TabEntity("贝币")
//        ));
//        prominentTabB.setOnTabSelectListener {
//            //Toast.makeText(this, "$it-->", Toast.LENGTH_SHORT).show()
//        };

        /*prominentTabC.tabEntityList = (
                mutableListOf(
                    TabEntity("鱼宠"),
                    TabEntity("道具"),
                    TabEntity("背景"),
                    TabEntity("贝币")))*/

//        prominentTabC.setTabData(
//            mutableListOf(
//                TabEntity("鱼宠"),
//                TabEntity("道具"),
//                TabEntity("背景"),
//                TabEntity("贝币")
//            ), this, R.id.flContainer, mutableListOf(
//                TestFragment.newInstance("鱼宠"),
//                TestFragment.newInstance("道具"),
//                TestFragment.newInstance("背景"),
//                TestFragment.newInstance("贝币")
//            )
//        )



    }
}